<%--
  Created by IntelliJ IDEA.
  User: Yancyxiaoone
  Date: 2022/11/8
  Time: 10:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body onload="run()">
正在销毁session,清除数据,
<span id="span"></span>秒之后进入登记页面
<%
    session.invalidate();
    response.setHeader("refresh", "3;url='index.jsp'");
%>
<script type="text/javascript">
    var x = 3;
    function run() {
        // 获取到的是span标签的对象
        var span = document.getElementById("span");
        // 获取span标签中间的文本
        span.innerHTML = x;
        x--;
        // 再让run方法执行呢，一秒钟执行一次
        window.setTimeout("run()", 1000);
    }
</script>
</body>
</html>
